package com.bawei.wyg.networkmodel.utils;

import android.content.SharedPreferences;

import com.bawei.wyg.commonapplication.BaseApplication;

public class SpUtils {
    private static String name="paper";
    private static String login="login";
    public static void saveData(String key,String value){
        SharedPreferences sp = BaseApplication.getAppContext().getSharedPreferences(name, 0);
        sp.edit().putString(key,value).commit();
    }
    public static void saveDatalogin(String key,boolean value){
        SharedPreferences sp = BaseApplication.getAppContext().getApplicationContext().getSharedPreferences(login, 0);
        sp.edit().putBoolean(key,value).commit();
    }
    public static String readData(String key,String value){
        SharedPreferences sp = BaseApplication.getAppContext().getSharedPreferences(name, 0);
        return sp.getString(key,"");
    }
    public static boolean readDatalogin(String key,boolean value){
        SharedPreferences sp = BaseApplication.getAppContext().getSharedPreferences(login, 0);
        return sp.getBoolean(key, value);
    }
}
